package com.keti.controller;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.keti.Dao.UserDao;
import com.keti.Dao.stuffDao;
import com.keti.DaoImpl.UserDaoImpl;
import com.keti.DaoImpl.suffDaoImpl;
import com.keti.pojo.User;
import com.keti.pojo.stuff;

/**
 * Servlet implementation class ToUpdataStuffServlet
 */
@WebServlet("/ToUpdataStuffServlet")
public class ToUpdataStuffServlet extends HttpServlet {
	
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		int id = Integer.parseInt(request.getParameter("id"));
		stuffDao sd = new suffDaoImpl();
		stuff s = new stuff();;
		s = sd.queryOne(id);
		request.setAttribute("s",s);
		request.getRequestDispatcher("jsp/stuff/Updata.jsp").forward(request, response);
	}


	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
